//Copyright (C) 2010 Phoenix. 

//This program is free software: you can redistribute it and/or modify 
//it under the terms of the GNU General Public License as published by 
//the Free Software Foundation, version 2.0. 

//This program is distributed in the hope that it will be useful, 
//but WITHOUT ANY WARRANTY; without even the implied warranty of 
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
//GNU General Public License 2.0 for more details. 

//A copy of the GPL 2.0 should have been included with the program. 
//If not, see http://www.gnu.org/licenses/ 

//Official SVN repository and contact information can be found at 
//http://code.google.com/p/ffcbeditor/


#ifndef __FFCBTextArchivePanelBase__
#define __FFCBTextArchivePanelBase__

/**
@file
Subclass of TextArchivePanel, which is generated by wxFormBuilder.
*/

#include "cbgui.h"
#include "../cblib/CBTextArchive.h"
#include "../cblib/CBTextSection.h"

/** Implementing TextArchivePanel */
class FFCBTextArchivePanelBase : public TextArchivePanel
{
protected:
	// Handlers for TextArchivePanel events.
	void OnPrevText( wxCommandEvent& event );
	void OnNextText( wxCommandEvent& event );
	void OnApply( wxCommandEvent& event );
	void OnSaveAll( wxCommandEvent& event );
	void OnTextSelected( wxCommandEvent& event );
	void OnCheckDuplicate( wxCommandEvent& event );
	virtual CBTextSection* GetTextSection(size_t idx)=0;
	virtual void SaveFile(wxString& fullName)=0;
	void PopulateView(size_t sectId);
	void UpdateView();
	void SaveCurrentText();
public:
	/** Constructor */
	FFCBTextArchivePanelBase( wxWindow* parent );


protected:
	
	size_t sectionId;
	wxString fileName;
	size_t curText;
};

#endif // __FFCBTextArchivePanel__
